package com.it.cloud.netty;

import com.it.cloud.netty.http.server.HttpNettyServer;
import com.it.cloud.netty.simple.server.NettyServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class NettyApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(NettyApplication.class, args);
    }

    @Autowired
    private NettyServer nettyServer;

    @Autowired
    private HttpNettyServer httpNettyServer;

    @Override
    public void run(String... args) {
        // B/S服务
        // nettyServer.start();

        // Http服务
        httpNettyServer.start();
    }
}
